package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;
import com.itboye.mengwu.data.interfaces.IMyComments;
import com.itboye.mengwu.data.model.MyCommentsModel;

public class MyCommentsRepository extends BaseNetRepository implements
		IMyComments<MyCommentsModel> {

	final String MY_COMMENTS = "BY_BbsUserCenter_queryComment";
	String api = "100";

	public MyCommentsRepository(ICompleteListener iCompleteListener) {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(MyCommentsModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(MyCommentsModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(MyCommentsModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(MyCommentsModel model) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<MyCommentsModel>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("uid", model.getUid());
		(new Builder<MyCommentsModel>())
				.setTypeVerParamsAndReturnClass(MY_COMMENTS, apiVer, params,
						type)
				.requestListener(
						new BaseSuccessReqListener<MyCommentsModel>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public List<MyCommentsModel> query(MyCommentsModel model) {
		// TODO Auto-generated method stub
		return null;
	}

}
